package io.spring.sample.graphql.repository;

import com.querydsl.core.types.Expression;
import com.querydsl.core.types.Visitor;
import lombok.Value;

import java.util.List;
import java.util.UUID;

/**
 * Unit 实体类投影
 * 不能替换实体类！
 * 报错Class-based DTOs are not yet supported.不能用在FluentQuery.FetchableFluentQuery<UnitDto> queryUse = query.as(UnitDto.class);
 * */

@Value
public class UnitDto {
    private UUID id;
    private String indCod;
    private String area;
    private Boolean cancel;

    public UnitDto(){
        this.id =null;
        this.indCod =null;
        this.area =null;
        this.cancel = null;
    }
    //No constructor found for class io.spring.sample.graphql.repository.UnitDto with parameters: [class java.util.UUID, class java.lang.String, class java.lang.Boolean]
    public UnitDto(UUID id,String indCod,Boolean cancel){
        this.id =id;
        this.indCod =indCod;
        this.area =null;
        this.cancel = cancel;
    }
    public UnitDto(Unit unit){
        this.id =unit.getId();
        this.indCod =unit.getIndCod();
        this.area =unit.getArea();
        this.cancel = unit.getCancel();
    }


}

